import request from '@/utils/request'

// 查询考勤记录列表
export function listSignRecord(query) {
  return request({
    url: '/attendance/signRecord/list',
    method: 'get',
    params: query
  })
}

// 考勤信息统计
export function getSignStatistic(query) {
  return request({
    url: '/attendance/signRecord/listForStatistic',
    method: 'get',
    params: query
  })
}

// 查询本人考勤记录列表
export function listSignRecordForOwn(query) {
  return request({
    url: '/attendance/signRecord/listForOwn',
    method: 'get',
    params: query
  })
}

// 查询考勤记录详细
export function getSignRecord(signId) {
  return request({
    url: '/attendance/signRecord/' + signId,
    method: 'get'
  })
}

export function getAttendanceStatus(){
  return request({
    url: '/attendance/signRecord/getStatus',
    method: 'get'
  })
}

// 新增考勤记录
export function addSignRecord(data) {
  return request({
    url: '/attendance/signRecord',
    method: 'post',
    data: data
  })
}

// 上传人脸照片进行对比
export function uploadPhoto(formData) {
  return request({
    url: '/face/match',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 修改考勤记录
export function updateSignRecord(data) {
  return request({
    url: '/attendance/signRecord',
    method: 'put',
    data: data
  })
}

// 删除考勤记录
export function delSignRecord(signId) {
  return request({
    url: '/attendance/signRecord/' + signId,
    method: 'delete'
  })
}
